/*=+--+=#=+--     Unmanned Aerial System Management Software      --+=#=+--+=#*\
|          Copyright (C) 2011 Regents of the University of Colorado.           |
|                             All Rights Reserved.                             |

     This program is free software: you can redistribute it and/or modify
     it under the terms of the GNU General Public License version 2 as
     published by the Free Software Foundation.

     This program is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.

     You should have received a copy of the GNU General Public License
     along with this program.  If not, see <http://www.gnu.org/licenses/>.

            Jack Elston                       Cory Dixon                        
|           elstonj@colorado.edu              dixonc@colorado.edu              |
|                                                                              |
\*=+--+=#=+--                 --+=#=+--+=#=+--                    --+=#=+--+=#*/

/*!
	\file layerList.h
	\author Cory Dixon
*/

#ifndef __LAYER_LIST_H
#define __LAYER_LIST_H

#include <gtk/gtk.h>
#include <goocanvas.h>

#include "type_defs.h"
#include "String.h"

class LayerList
{
private:
	GtkWidget    * layer_list;
	GtkTreeStore * tree_model;
	GtkTreeView  * treeview;

	void format_treeview(); // this formats the columns

	bool searchTree(GooCanvasItem *parent, GtkTreeIter &p_iter);
	bool getIterFromParent(GooCanvasItem *parent, GtkTreeIter &iter) ;

	static void item_toggled (GtkCellRendererToggle *cell, gchar *path_str, gpointer data);

public:
	LayerList();
	~LayerList();

	void init();
	void addLayer(String name, GooCanvasItem *item, GooCanvasItem *parent=NULL, const char *tooltip = NULL);
	void setShown(GooCanvasItem *item, bool val);
	void delLayer(GooCanvasItem *item);

	// columns for GtkTreeStore
	typedef enum {
		NAME_COLUMN = 0,
		VISIBLE_COLUMN,
		ITEM_COLUMN,
		NUM_COLUMNS
	} Columns;
};

#endif
